package com.ruoyi.mall.mapper;

import java.util.List;
import java.util.Map;

import com.ruoyi.mall.domain.MallMemberCoupon;
import com.ruoyi.mall.domain.MallMemberUser;
import com.ruoyi.mall.domain.vo.IndexGoodsVO;
import com.ruoyi.mall.domain.vo.MemberCollectVO;
import com.ruoyi.mall.domain.vo.MemberFootMarkVO;
import com.ruoyi.mall.domain.vo.MemberUserVO;
import org.apache.ibatis.annotations.Param;

/**
 * 会员Mapper接口
 *
 * @author ruoyi
 * @date 2021-11-25
 */
public interface MallMemberUserMapper
{
    /**
     * 查询会员
     *
     * @param id 会员主键
     * @return 会员
     */
    public MallMemberUser selectMallMemberUserById(Long id);

    public MallMemberUser queryByOpenid(String openid);
    public MallMemberUser queryByPhone(String openid);

    /**
     * 查询会员列表
     *
     * @param mallMemberUser 会员
     * @return 会员集合
     */
    public List<MallMemberUser> selectMallMemberUserList(MallMemberUser mallMemberUser);

    /**
     * 新增会员
     *
     * @param mallMemberUser 会员
     * @return 结果
     */
    public int insertMallMemberUser(MallMemberUser mallMemberUser);

    /**
     * 修改会员
     *
     * @param mallMemberUser 会员
     * @return 结果
     */
    public int updateMallMemberUser(MallMemberUser mallMemberUser);

    /**
     * 删除会员
     *
     * @param id 会员主键
     * @return 结果
     */
    public int deleteMallMemberUserById(Long id);

    /**
     * 批量删除会员
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteMallMemberUserByIds(Long[] ids);

    public MemberUserVO selectMemberVOUserById(Long l);

    /*
    * 查询收藏
    * */
    public int selectCollectCount(Map<String, Object> params);

    /*
    * 收藏
    * */
    public void insertMemberGoods(MemberCollectVO memberGoods);

    /*
     * 取消收藏
     * */
    public void deleteMemberGoodsByParam(Map<String, Object> params);

    /*
    * 收藏列表
    * */
    public List<IndexGoodsVO> queryCollectByUserUserId(Long userId);

    /*
     * 足迹列表
     * */
    public List<IndexGoodsVO> queryFoodMarkByUserUserId(Long userId);

    /*
     * 查询足迹
     * */
    public MemberFootMarkVO selectFootMarkVOUserById(MemberFootMarkVO footMarkVO);

    /*
     * 更新足迹
     * */
    public void updateFootMarkVO(MemberFootMarkVO footMarkVO);

    /*
     * 插入足迹
     * */
    public void insetIntoFootMarkVO(MemberFootMarkVO footMarkVO);

    public MemberCollectVO selectIsCollectBy(MemberCollectVO collectVO);

    public Map<String,Object> checkUserCoupon(@Param("userId") Long userId, @Param("couponId") String couponId);

    public void insertUserCoupon(MallMemberCoupon memberCoupon);

    public List<Map<String,Object>> getMyCoupons(Long userId);

    //查看优惠券是否可用
    public Map<String,Object> checkCouponUsed(@Param("couponId") String couponId, @Param("userId") Long userId);

    //又该优惠券状态为使用
    public void updateCouponUsed(@Param("couponId") String couponId, @Param("userId") Long userId);

    public int selectCollectCountByUserId(Long userId);

    public int selectCouponCountByUserId(Long userId);

    public int selectFootCountByUserId(Long userId);

    /**
     * 根据手机号查询会员
     *
     * @param phone 手机号
     * @return 会员
     */
    public MallMemberUser selectMallMemberUserByPhone(String phone);

    /**
     * 修改会员支付信息
     *
     * @param mallMemberUser 会员
     * @return 结果
     */
    public int updateUserPaymentInfo(MallMemberUser mallMemberUser);

    /**
     * 修改推荐人信息
     *
     * @param mallMemberUser 会员
     * @return 结果
     */
    public int updateUserIntroUserInfo(MallMemberUser mallMemberUser);

    /**
     * 查询分销商列表
     *
     * @param mallMemberUser 会员
     * @return 会员集合
     */
    public List<MallMemberUser> selectDistributorList(MallMemberUser mallMemberUser);
}
